import Vue from 'vue'

// 导入element-ui,语言设置为中文
import ElementUI from 'element-ui'
import locale from 'element-ui/lib/locale/lang/zh-CN'
Vue.use(ElementUI, { locale })

// 导入element-ui的样式
import '../src/assets/style/theme/index.css'

// 导入vue-router
import router from './router'

// 导入vuex
import store from './store'
Vue.use(store)
Vue.prototype.$store = store

// 导入axios
import axios from './api/http'
Vue.prototype.$http = axios
import api from './api'
Vue.prototype.$api = api

// 导入dayjs
import dayjs from 'dayjs'
import * as isLeapYear from 'dayjs/plugin/isLeapYear' // import plugin
import 'dayjs/locale/zh-cn' // import locale
dayjs.extend(isLeapYear) // use plugin
dayjs.locale('zh-cn') // use locale

// 导入 vue-json-viewer
import JsonViewer from 'vue-json-viewer'
Vue.use(JsonViewer)

// 导入工具
import util from './util'
Vue.prototype.$util = util

// 导入全局样式
import './assets/scss/index.scss'

// 注册全局组件
import EChart from './components/EChart.vue'
Vue.component('e-chart', EChart)
import ETagInput from './components/ETagInput.vue'
Vue.component('e-tag-input', ETagInput)

Vue.config.productionTip = false

// 判断环境
Vue.prototype.$isDev = process.env.NODE_ENV === 'development'

// 挂载App
import App from './App.vue'
new Vue({ render: (h) => h(App), router }).$mount('#app')
